home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Audio / AC3 / AC3Dec / imdct.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-14  |  13.8 KB  |  480 lines

  1. /* 
  2.  *  imdct.c
  3.  *
  4.  *    Copyright (C) Aaron Holtzman - May 1999
  5.  *
  6.  *  This file is part of ac3dec, a free Dolby AC-3 stream decoder.
  7.  *    
  8.  *  ac3dec is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2, or (at your option)
  11.  *  any later version.
  12.  *   
  13.  *  ac3dec is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *   
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with GNU Make; see the file COPYING.  If not, write to
  20.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  21.  *
  22.  *
  23.  */
  24.  
  25. #include <stdlib.h>
  26. #include <stdio.h>
  27. #include <math.h>
  28. #include "ac3.h"
  29. #include "ac3_internal.h"
  30.  
  31.  
  32. #include "decode.h"
  33. #include "imdct.h"
  34.  
  35. void imdct_do_256(float data[],float delay[]);
  36. void imdct_do_512(float data[],float delay[]);
  37.  
  38. typedef struct complex_s
  39. {
  40.     float real;
  41.     float imag;
  42. } complex_t;
  43.  
  44.  
  45. #define N 512
  46. #define M_PI 3.14159265358979323846264
  47.  
  48. /* 128 point bit-reverse LUT */
  49. static uint_8 bit_reverse_512[] = {
  50.     0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70, 
  51.     0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78, 
  52.     0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74, 
  53.     0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c, 
  54.     0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72, 
  55.     0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a, 
  56.     0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76, 
  57.     0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e, 
  58.     0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71, 
  59.     0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79, 
  60.     0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75, 
  61.     0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d, 
  62.     0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73, 
  63.     0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b, 
  64.     0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77, 
  65.     0x0f, 0x4f, 0x2f, 0x6f, 0x1f, 0x5f, 0x3f, 0x7f};
  66.  
  67. static uint_8 bit_reverse_256[] = {
  68.     0x00, 0x20, 0x10, 0x30, 0x08, 0x28, 0x18, 0x38, 
  69.     0x04, 0x24, 0x14, 0x34, 0x0c, 0x2c, 0x1c, 0x3c, 
  70.     0x02, 0x22, 0x12, 0x32, 0x0a, 0x2a, 0x1a, 0x3a, 
  71.     0x06, 0x26, 0x16, 0x36, 0x0e, 0x2e, 0x1e, 0x3e, 
  72.     0x01, 0x21, 0x11, 0x31, 0x09, 0x29, 0x19, 0x39, 
  73.     0x05, 0x25, 0x15, 0x35, 0x0d, 0x2d, 0x1d, 0x3d, 
  74.     0x03, 0x23, 0x13, 0x33, 0x0b, 0x2b, 0x1b, 0x3b, 
  75.     0x07, 0x27, 0x17, 0x37, 0x0f, 0x2f, 0x1f, 0x3f};
  76.  
  77. static complex_t buf[128];
  78.  
  79. /* Twiddle factor LUT */
  80. static complex_t *w[7];
  81. static complex_t w_1[1];
  82. static complex_t w_2[2];
  83. static complex_t w_4[4];
  84. static complex_t w_8[8];
  85. static complex_t w_16[16];
  86. static complex_t w_32[32];
  87. static complex_t w_64[64];
  88.  
  89. /* Twiddle factors for IMDCT */
  90. static float xcos1[128];
  91. static float xsin1[128];
  92. static float xcos2[64];
  93. static float xsin2[64];
  94.  
  95. /* Delay buffer for time domain interleaving */
  96. static float delay[6][256];
  97.  
  98. /* Windowing function for Modified DCT - Thank you acroread */
  99. static float window[] = {
  100.     0.00014f, 0.00024f, 0.00037f, 0.00051f, 0.00067f, 0.00086f, 0.00107f, 0.00130f,
  101.     0.00157f, 0.00187f, 0.00220f, 0.00256f, 0.00297f, 0.00341f, 0.00390f, 0.00443f,
  102.     0.00501f, 0.00564f, 0.00632f, 0.00706f, 0.00785f, 0.00871f, 0.00962f, 0.01061f,
  103.     0.01166f, 0.01279f, 0.01399f, 0.01526f, 0.01662f, 0.01806f, 0.01959f, 0.02121f,
  104.     0.02292f, 0.02472f, 0.02662f, 0.02863f, 0.03073f, 0.03294f, 0.03527f, 0.03770f,
  105.     0.04025f, 0.04292f, 0.04571f, 0.04862f, 0.05165f, 0.05481f, 0.05810f, 0.06153f,
  106.     0.06508f, 0.06878f, 0.07261f, 0.07658f, 0.08069f, 0.08495f, 0.08935f, 0.09389f,
  107.     0.09859f, 0.10343f, 0.10842f, 0.11356f, 0.11885f, 0.12429f, 0.12988f, 0.13563f,
  108.     0.14152f, 0.14757f, 0.15376f, 0.16011f, 0.16661f, 0.17325f, 0.18005f, 0.18699f,
  109.     0.19407f, 0.20130f, 0.20867f, 0.21618f, 0.22382f, 0.23161f, 0.23952f, 0.24757f,
  110.     0.25574f, 0.26404f, 0.27246f, 0.28100f, 0.28965f, 0.29841f, 0.30729f, 0.31626f,
  111.     0.32533f, 0.33450f, 0.34376f, 0.35311f, 0.36253f, 0.37204f, 0.38161f, 0.39126f,
  112.     0.40096f, 0.41072f, 0.42054f, 0.43040f, 0.44030f, 0.45023f, 0.46020f, 0.47019f,
  113.     0.48020f, 0.49022f, 0.50025f, 0.51028f, 0.52031f, 0.53033f, 0.54033f, 0.55031f,
  114.     0.56026f, 0.57019f, 0.58007f, 0.58991f, 0.59970f, 0.60944f, 0.61912f, 0.62873f,
  115.     0.63827f, 0.64774f, 0.65713f, 0.66643f, 0.67564f, 0.68476f, 0.69377f, 0.70269f,
  116.     0.71150f, 0.72019f, 0.72877f, 0.73723f, 0.74557f, 0.75378f, 0.76186f, 0.76981f,
  117.     0.77762f, 0.78530f, 0.79283f, 0.80022f, 0.80747f, 0.81457f, 0.82151f, 0.82831f,
  118.     0.83496f, 0.84145f, 0.84779f, 0.85398f, 0.86001f, 0.86588f, 0.87160f, 0.87716f,
  119.     0.88257f, 0.88782f, 0.89291f, 0.89785f, 0.90264f, 0.90728f, 0.91176f, 0.91610f,
  120.     0.92028f, 0.92432f, 0.92822f, 0.93197f, 0.93558f, 0.93906f, 0.94240f, 0.94560f,
  121.     0.94867f, 0.95162f, 0.95444f, 0.95713f, 0.95971f, 0.96217f, 0.96451f, 0.96674f,
  122.     0.96887f, 0.97089f, 0.97281f, 0.97463f, 0.97635f, 0.97799f, 0.97953f, 0.98099f,
  123.     0.98236f, 0.98366f, 0.98488f, 0.98602f, 0.98710f, 0.98811f, 0.98905f, 0.98994f,
  124.     0.99076f, 0.99153f, 0.99225f, 0.99291f, 0.99353f, 0.99411f, 0.99464f, 0.99513f,
  125.     0.99558f, 0.99600f, 0.99639f, 0.99674f, 0.99706f, 0.99736f, 0.99763f, 0.99788f,
  126.     0.99811f, 0.99831f, 0.99850f, 0.99867f, 0.99882f, 0.99895f, 0.99908f, 0.99919f,
  127.     0.99929f, 0.99938f, 0.99946f, 0.99953f, 0.99959f, 0.99965f, 0.99969f, 0.99974f,
  128.     0.99978f, 0.99981f, 0.99984f, 0.99986f, 0.99988f, 0.99990f, 0.99992f, 0.99993f,
  129.     0.99994f, 0.99995f, 0.99996f, 0.99997f, 0.99998f, 0.99998f, 0.99998f, 0.99999f,
  130.     0.99999f, 0.99999f, 0.99999f, 1.00000f, 1.00000f, 1.00000f, 1.00000f, 1.00000f,
  131.     1.00000f, 1.00000f, 1.00000f, 1.00000f, 1.00000f, 1.00000f, 1.00000f, 1.00000f };
  132.  
  133.  
  134. static inline void swap_cmplx(complex_t *a, complex_t *b)
  135. {
  136.     complex_t tmp;
  137.  
  138.     tmp = *a;
  139.     *a = *b;
  140.     *b = tmp;
  141. }
  142.  
  143.  
  144.  
  145. static inline complex_t cmplx_mult(complex_t a, complex_t b)
  146. {
  147.     complex_t ret;
  148.  
  149.     ret.real = a.real * b.real - a.imag * b.imag;
  150.     ret.imag = a.real * b.imag + a.imag * b.real;
  151.  
  152.     return ret;
  153. }
  154.  
  155. void imdct_init(void)
  156. {
  157.     int i,k;
  158.     complex_t angle_step;
  159.     complex_t current_angle;
  160.  
  161.     /* Twiddle factors to turn IFFT into IMDCT */
  162.     for( i=0; i < 128; i++)
  163.     {
  164.         xcos1[i] = (float)-cos(2.0f * M_PI * (8*i+1)/(8*N)) ; 
  165.         xsin1[i] = (float)-sin(2.0f * M_PI * (8*i+1)/(8*N)) ;
  166.     }
  167.     
  168.     /* More twiddle factors to turn IFFT into IMDCT */
  169.     for( i=0; i < 64; i++)
  170.     {
  171.         xcos2[i] = (float)-cos(2.0f * M_PI * (8*i+1)/(4*N)) ; 
  172.         xsin2[i] = (float)-sin(2.0f * M_PI * (8*i+1)/(4*N)) ;
  173.     }
  174.  
  175.     /* Canonical twiddle factors for FFT */
  176.     w[0] = w_1;
  177.     w[1] = w_2;
  178.     w[2] = w_4;
  179.     w[3] = w_8;
  180.     w[4] = w_16;
  181.     w[5] = w_32;
  182.     w[6] = w_64;
  183.  
  184.     for( i = 0; i < 7; i++)
  185.     {
  186.         angle_step.real = (float)cos(-2.0 * M_PI / (1 << (i+1)));
  187.         angle_step.imag = (float)sin(-2.0 * M_PI / (1 << (i+1)));
  188.  
  189.         current_angle.real = 1.0;
  190.         current_angle.imag = 0.0;
  191.  
  192.         for (k = 0; k < 1 << i; k++)
  193.         {
  194.             w[i][k] = current_angle;
  195.             current_angle = cmplx_mult(current_angle,angle_step);
  196.         }
  197.     }
  198. }
  199.  
  200. void
  201. imdct_do_512(float data[],float delay[])
  202. {
  203.     int i,k;
  204.     int p,q;
  205.     int m;
  206.     int two_m;
  207.     int two_m_plus_one;
  208.  
  209.     float tmp_a_i;
  210.     float tmp_a_r;
  211.     float tmp_b_i;
  212.     float tmp_b_r;
  213.  
  214.     float *data_ptr;
  215.     float *delay_ptr;
  216.     float *window_ptr;
  217.     
  218.     //
  219.     // 512 IMDCT with source and dest data in 'data'
  220.     //
  221.     
  222.     // Pre IFFT complex multiply plus IFFT cmplx conjugate 
  223.     for( i=0; i < 128; i++)
  224.     {
  225.         /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ 
  226.         buf[i].real =         (data[256-2*i-1] * xcos1[i])  -  (data[2*i]       * xsin1[i]);
  227.       buf[i].imag = -1.0f * ((data[2*i]       * xcos1[i])  +  (data[256-2*i-1] * xsin1[i]));
  228.     }
  229.  
  230.     //Bit reversed shuffling
  231.     for(i=0; i<128; i++) 
  232.     { 
  233.         k = bit_reverse_512[i];
  234.         if (k < i)
  235.             swap_cmplx(&buf[i],&buf[k]);
  236.     }
  237.  
  238.     /* FFT Merge */
  239.     for (m=0; m < 7; m++)
  240.     {
  241.         if(m)
  242.             two_m = (1 << m);
  243.         else
  244.             two_m = 1;
  245.  
  246.         two_m_plus_one = (1 << (m+1));
  247.  
  248.         for(k = 0; k < two_m; k++)
  249.         {
  250.             for(i = 0; i < 128; i += two_m_plus_one)
  251.             {
  252.                 p = k + i;
  253.                 q = p + two_m;
  254.                 tmp_a_r = buf[p].real;
  255.                 tmp_a_i = buf[p].imag;
  256.                 tmp_b_r = buf[q].real * w[m][k].real - buf[q].imag * w[m][k].imag;
  257.                 tmp_b_i = buf[q].imag * w[m][k].real + buf[q].real * w[m][k].imag;
  258.                 buf[p].real = tmp_a_r + tmp_b_r;
  259.                 buf[p].imag =  tmp_a_i + tmp_b_i;
  260.                 buf[q].real = tmp_a_r - tmp_b_r;
  261.                 buf[q].imag =  tmp_a_i - tmp_b_i;
  262.  
  263.             }
  264.         }
  265.     }
  266.  
  267.     /* Post IFFT complex multiply  plus IFFT complex conjugate*/
  268.     for( i=0; i < 128; i++)
  269.     {
  270.         /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
  271.         tmp_a_r =        buf[i].real;
  272.         tmp_a_i = -1.0f * buf[i].imag;
  273.         buf[i].real =(tmp_a_r * xcos1[i])  -  (tmp_a_i  * xsin1[i]);
  274.       buf[i].imag =(tmp_a_r * xsin1[i])  +  (tmp_a_i  * xcos1[i]);
  275.     }
  276.     
  277.     data_ptr = data;
  278.     delay_ptr = delay;
  279.     window_ptr = window;
  280.  
  281.     /* Window and convert to real valued signal */
  282.     for(i=0; i< 64; i++) 
  283.     { 
  284.         *data_ptr++   = 2.0f * (-buf[64+i].imag   * *window_ptr++ + *delay_ptr++); 
  285.         *data_ptr++   = 2.0f * ( buf[64-i-1].real * *window_ptr++ + *delay_ptr++); 
  286.     }
  287.  
  288.     for(i=0; i< 64; i++) 
  289.     { 
  290.         *data_ptr++  = 2.0f * (-buf[i].real       * *window_ptr++ + *delay_ptr++); 
  291.         *data_ptr++  = 2.0f * ( buf[128-i-1].imag * *window_ptr++ + *delay_ptr++); 
  292.     }
  293.     
  294.     /* The trailing edge of the window goes into the delay line */
  295.     delay_ptr = delay;
  296.  
  297.     for(i=0; i< 64; i++) 
  298.     { 
  299.         *delay_ptr++  = -buf[64+i].real   * *--window_ptr; 
  300.         *delay_ptr++  =  buf[64-i-1].imag * *--window_ptr; 
  301.     }
  302.  
  303.     for(i=0; i<64; i++) 
  304.     {
  305.         *delay_ptr++  =  buf[i].imag       * *--window_ptr; 
  306.         *delay_ptr++  = -buf[128-i-1].real * *--window_ptr; 
  307.     }
  308. }
  309.  
  310. void
  311. imdct_do_256(float data[],float delay[])
  312. {
  313.     int i,k;
  314.     int p,q;
  315.     int m;
  316.     int two_m;
  317.     int two_m_plus_one;
  318.  
  319.     float tmp_a_i;
  320.     float tmp_a_r;
  321.     float tmp_b_i;
  322.     float tmp_b_r;
  323.  
  324.     float *data_ptr;
  325.     float *delay_ptr;
  326.     float *window_ptr;
  327.  
  328.     complex_t *buf_1, *buf_2;
  329.  
  330.     buf_1 = &buf[0];
  331.     buf_2 = &buf[64];
  332.  
  333.     /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
  334.     for(k=0; k<64; k++) 
  335.     { 
  336.         /* X1[k] = X[2*k]  */
  337.         /* X2[k] = X[2*k+1]     */
  338.  
  339.         p = 2 * (128-2*k-1);
  340.         q = 2 * (2 * k);
  341.  
  342.         /* Z1[k] = (X1[128-2*k-1] + j * X1[2*k]) * (xcos2[k] + j * xsin2[k]); */ 
  343.         buf_1[k].real =         data[p] * xcos2[k] - data[q] * xsin2[k];
  344.       buf_1[k].imag = -1.0f * (data[q] * xcos2[k] + data[p] * xsin2[k]); 
  345.         /* Z2[k] = (X2[128-2*k-1] + j * X2[2*k]) * (xcos2[k] + j * xsin2[k]); */ 
  346.         buf_2[k].real =          data[p + 1] * xcos2[k] - data[q + 1] * xsin2[k];
  347.       buf_2[k].imag = -1.0f * ( data[q + 1] * xcos2[k] + data[p + 1] * xsin2[k]); 
  348.     }
  349.  
  350.     //IFFT Bit reversed shuffling
  351.     for(i=0; i<64; i++) 
  352.     { 
  353.         k = bit_reverse_256[i];
  354.         if (k < i)
  355.         {
  356.             swap_cmplx(&buf_1[i],&buf_1[k]);
  357.             swap_cmplx(&buf_2[i],&buf_2[k]);
  358.         }
  359.     }
  360.  
  361.     /* FFT Merge */
  362.     for (m=0; m < 6; m++)
  363.     {
  364.         two_m = (1 << m);
  365.         two_m_plus_one = (1 << (m+1));
  366.  
  367.         //FIXME
  368.         if(m)
  369.             two_m = (1 << m);
  370.         else
  371.             two_m = 1;
  372.  
  373.         for(k = 0; k < two_m; k++)
  374.         {
  375.             for(i = 0; i < 64; i += two_m_plus_one)
  376.             {
  377.                 p = k + i;
  378.                 q = p + two_m;
  379.                 //Do block 1
  380.                 tmp_a_r = buf_1[p].real;
  381.                 tmp_a_i = buf_1[p].imag;
  382.                 tmp_b_r = buf_1[q].real * w[m][k].real - buf_1[q].imag * w[m][k].imag;
  383.                 tmp_b_i = buf_1[q].imag * w[m][k].real + buf_1[q].real * w[m][k].imag;
  384.                 buf_1[p].real = tmp_a_r + tmp_b_r;
  385.                 buf_1[p].imag =  tmp_a_i + tmp_b_i;
  386.                 buf_1[q].real = tmp_a_r - tmp_b_r;
  387.                 buf_1[q].imag =  tmp_a_i - tmp_b_i;
  388.  
  389.                 //Do block 2
  390.                 tmp_a_r = buf_2[p].real;
  391.                 tmp_a_i = buf_2[p].imag;
  392.                 tmp_b_r = buf_2[q].real * w[m][k].real - buf_2[q].imag * w[m][k].imag;
  393.                 tmp_b_i = buf_2[q].imag * w[m][k].real + buf_2[q].real * w[m][k].imag;
  394.                 buf_2[p].real = tmp_a_r + tmp_b_r;
  395.                 buf_2[p].imag =  tmp_a_i + tmp_b_i;
  396.                 buf_2[q].real = tmp_a_r - tmp_b_r;
  397.                 buf_2[q].imag =  tmp_a_i - tmp_b_i;
  398.  
  399.             }
  400.         }
  401.     }
  402.  
  403.     /* Post IFFT complex multiply */
  404.     for( i=0; i < 64; i++)
  405.     {
  406.         /* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */ 
  407.         tmp_a_r =  buf_1[i].real;
  408.         tmp_a_i = -buf_1[i].imag;
  409.         buf_1[i].real =(tmp_a_r * xcos2[i])  -  (tmp_a_i  * xsin2[i]);
  410.       buf_1[i].imag =(tmp_a_r * xsin2[i])  +  (tmp_a_i  * xcos2[i]);
  411.         /* y2[n] = z2[n] * (xcos2[n] + j * xsin2[n]) ; */ 
  412.         tmp_a_r =  buf_2[i].real;
  413.         tmp_a_i = -buf_2[i].imag;
  414.         buf_2[i].real =(tmp_a_r * xcos2[i])  -  (tmp_a_i  * xsin2[i]);
  415.       buf_2[i].imag =(tmp_a_r * xsin2[i])  +  (tmp_a_i  * xcos2[i]);
  416.     }
  417.     
  418.     data_ptr = data;
  419.     delay_ptr = delay;
  420.     window_ptr = window;
  421.  
  422.     /* Window and convert to real valued signal */
  423.     for(i=0; i< 64; i++) 
  424.     { 
  425.         *data_ptr++  = 2.0f * (-buf_1[i].imag      * *window_ptr++ + *delay_ptr++);
  426.         *data_ptr++  = 2.0f * ( buf_1[64-i-1].real * *window_ptr++ + *delay_ptr++);
  427.     }
  428.  
  429.     for(i=0; i< 64; i++) 
  430.     {
  431.         *data_ptr++  = 2.0f * (-buf_1[i].real      * *window_ptr++ + *delay_ptr++);
  432.         *data_ptr++  = 2.0f * ( buf_1[64-i-1].imag * *window_ptr++ + *delay_ptr++);
  433.     }
  434.     
  435.     delay_ptr = delay;
  436.  
  437.     for(i=0; i< 64; i++) 
  438.     {
  439.         *delay_ptr++ = -buf_2[i].real      * *--window_ptr;
  440.         *delay_ptr++ =  buf_2[64-i-1].imag * *--window_ptr;
  441.     }
  442.  
  443.     for(i=0; i< 64; i++) 
  444.     {
  445.         *delay_ptr++ =  buf_2[i].imag      * *--window_ptr;
  446.         *delay_ptr++ = -buf_2[64-i-1].real * *--window_ptr;
  447.     }
  448. }
  449.  
  450. //FIXME remove - for timing code
  451. ///#include <sys/time.h>
  452. //FIXME remove
  453.  
  454. void 
  455. imdct(bsi_t *bsi,audblk_t *audblk, stream_samples_t samples) {
  456.     int i;
  457.  
  458.     //handy timing code
  459.     //struct timeval start,end;
  460.  
  461.     //gettimeofday(&start,0);
  462.     
  463.     for(i=0; i<bsi->nfchans;i++)
  464.     {
  465.         if(audblk->blksw[i])
  466.             imdct_do_256(samples[i],delay[i]);
  467.         else
  468.             imdct_do_512(samples[i],delay[i]);
  469.     }
  470.     //gettimeofday(&end,0);
  471.     //printf("imdct %ld us\n",(end.tv_sec - start.tv_sec) * 1000000 +
  472.         //end.tv_usec - start.tv_usec);
  473.  
  474.     //XXX We don't bother with the IMDCT for the LFE as it's currently
  475.     //unused.
  476.     //if (bsi->lfeon)
  477.     //    imdct_do_512(coeffs->lfe,samples->channel[5],delay[5]);
  478.     //    
  479. }
  480.